package common.data.cmd
{
	import mx.collections.ArrayCollection;
	import mx.rpc.events.ResultEvent;
	import mx.rpc.remoting.RemoteObject;

	/**
	 * 命令服务类
	 */
	public class CmdService extends RemoteObject
	{
		public var sendGetPosCmdCallBack:Function;
//		public var searchGetPosCmdStateCallBack:Function;
		
		
		public function CmdService() {
			super("cmdService");
			this.showBusyCursor = false;
			this.getOperation("sendGetPosCmd").addEventListener(ResultEvent.RESULT,sendGetPosCmdResult,false,0,true);
//			this.getOperation("searchGetPosCmdState").addEventListener(ResultEvent.RESULT,searchGetPosCmdStateResult,false,0,true);
		}
		
		//发送点名指令
		public function sendGetPosCmd(ac:ArrayCollection):void{
			this.getOperation("sendGetPosCmd").send(ac);
		}
		
		//查询点名指令回传状态
//		public function searchGetPosCmdState(ac:ArrayCollection):void{
//			this.getOperation("searchGetPosCmdState").send(ac);
//		}
		
		//回调点名命令
		private function sendGetPosCmdResult(e:ResultEvent):void{
			try{
				if(sendGetPosCmdCallBack != null){
					sendGetPosCmdCallBack.apply(this,[e]);
				}
			}catch(error:Error){
				trace(error.getStackTrace());
			}
		}
		
//		//回调查询点名指令回传状态
//		private function searchGetPosCmdStateResult(e:ResultEvent):void{
//			try{
//				if(searchGetPosCmdStateCallBack !=null){
//					searchGetPosCmdStateCallBack.apply(this,[e]);
//				}
//			}catch(error:Error) {
//				
//			}
//		}
		
	}
}	